package com.bugreport.test.utils;

import java.util.Properties;

import com.bugreport.configuration.BugTrackerConfiguration;
import com.bugreport.utils.BugReportException;

public class BugTrackerTestConfiguration2 extends BugTrackerConfiguration {

	public static final String KEY = "type2";

	public BugTrackerTestConfiguration2(Integer configId, String key, String matcher) {
		super.setId(configId);
		super.setBugTrackerKey(key);
		super.setUrlPatternMatcher(matcher);
	}

	public static BugTrackerTestConfiguration2 load(Properties properties, Integer configId) throws BugReportException {

		String bugTrackerKey = BugTrackerConfiguration.getBugTrackerKey(properties, configId);
		String urlPatternMatcher = BugTrackerConfiguration.getUrlPatternMatcher(properties, configId);

		return new BugTrackerTestConfiguration2(configId, bugTrackerKey, urlPatternMatcher);
	}

	@Override
	protected String getConnectorSpringId() {
		return KEY;
	}
}
